<?php

namespace App\Api\Controller;

use App\Api\Transformers\ClubVideoTransformer;
use App\ClubVideos;
use Illuminate\Http\Request;


/**
 * Class ClubController
 * @package App\Api\Controller
 */
class ClubVideoController extends BaseController
{
    /**
     * return Club Videos
     *
     * @param Request $request
     * @return \Dingo\Api\Http\Response
     */
     public function show(Request $request)
     {
         $club_id = $request->get('club_id');
         $clubVideo = ClubVideos::where('club_id',$club_id)->select('id', 'club_id', 'cvideo_name', 'cvideo_pic', 'cvideo_address')->get();
         if($clubVideo->isEmpty())
         {
             return $this->response->errorNotFound('未找到该俱乐部课程详情');
         }
         return $this->response->item($clubVideo, new ClubVideoTransformer());
     }
}